home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3087 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  28 lines

  1. Newsgroups: comp.lang.c
  2. Path: netcom.com!cader
  3. From: cader@netcom.com (Charles Ader)
  4. Subject: Re: How to test a random generator ?
  5. Message-ID: <caderDLrHrt.2z5@netcom.com>
  6. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  7. X-Newsreader: TIN [version 1.2 PL1]
  8. References: <4e2q7g$oe@centre.univ-orleans.fr> <4e933p$t25@longwood.cs.ucf.edu>
  9. Date: Fri, 26 Jan 1996 00:09:29 GMT
  10. Sender: cader@netcom3.netcom.com
  11.  
  12. The tests used to validate a random number generator (RNG) depend
  13. on just what the RNG is to be used for. An algorithmic RNG is not
  14. recommended for cryptographic use. True randomness is best derrived
  15. from some physical source (keyboard typeing measured in milliseconds,
  16. thermal noise from a diode junction, radiation particle decay).
  17.  
  18. Algorithmic RNG are also called Pseudo random sequence generators.
  19. The best ones exhibit a uniform dispersion of digits over the
  20. range you intend to use. So if you want to validate a RNG
  21. over the range of 0-19 run your RNG for several million 
  22. calls and build a 20 bin histogram of the results, if any bin
  23. accumulates more than the others your distribution is skewed.
  24. The key to this type of test is to make sure that the RNG
  25. cycles through all of its possible states several times.
  26.  
  27. Charles.
  28.